{{ header }}{{ column_left }}
<div id="content">
  <div class="page-header">
    <div class="container-fluid">
      <div class="float-right">
        <button type="submit" form="form-payment" data-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fas fa-save"></i></button>
        <a href="{{ cancel }}" data-toggle="tooltip" title="{{ button_cancel }}" class="btn btn-light"><i class="fas fa-reply"></i></a></div>
      <h1>{{ heading_title }}</h1>
      <ol class="breadcrumb">
        {% for breadcrumb in breadcrumbs %}
          <li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
        {% endfor %}
      </ol>
    </div>
  </div>
  <div class="container-fluid">{% if error_warning %}
      <div class="alert alert-danger alert-dismissible"><i class="fas fa-exclamation-circle"></i> {{ error_warning }}
        <button type="button" class="close" data-dismiss="alert">&times;</button>
      </div>
    {% endif %}
    {% if success %}
      <div class="alert alert-success alert-dismissible"><i class="fas fa-check-circle"></i> {{ success }}
        <button type="button" class="close" data-dismiss="alert">&times;</button>
      </div>
    {% endif %}
    <div class="card">
      <div class="card-header"><i class="fas fa-pencil-alt"></i> {{ text_edit }}</div>
      <div class="card-body">
        <form action="{{ action }}" method="post" enctype="multipart/form-data" id="form-payment">
          <ul class="nav nav-tabs">
            <li class="nav-item" id="li-tab-settings"><a href="#tab-settings" data-toggle="tab" class="nav-link active">{{ tab_settings }}</a></li>
            <li class="nav-item" id="li-tab-order-status"><a href="#tab-order-status" data-toggle="tab" class="nav-link">{{ tab_order_status }}</a></li>
          </ul>
          <div class="tab-content">
            <div class="tab-pane active" id="tab-settings">
              <div class="form-group row required">
                <label class="col-sm-2 col-form-label" for="input-merchant-id">{{ entry_merchant_id }}</label>
                <div class="col-sm-10">
                  <input type="text" name="payment_cardconnect_merchant_id" value="{{ payment_cardconnect_merchant_id }}" placeholder="{{ entry_merchant_id }}" id="input-merchant-id" class="form-control"/>
                  <small class="form-text text-muted">{{ help_merchant_id }}</small>
                  {% if error_merchant_id %}
                    <div class="invalid-tooltip">{{ error_merchant_id }}</div>
                  {% endif %}</div>
              </div>
              <div class="form-group row required">
                <label class="col-sm-2 col-form-label" for="input-api-username">{{ entry_api_username }}</label>
                <div class="col-sm-10">
                  <input type="text" name="payment_cardconnect_api_username" value="{{ payment_cardconnect_api_username }}" placeholder="{{ entry_api_username }}" id="input-api-username" class="form-control"/>
                  <small class="form-text text-muted">{{ help_api_username }}</small>
                  {% if error_api_username %}
                    <div class="invalid-tooltip">{{ error_api_username }}</div>
                  {% endif %}</div>
              </div>
              <div class="form-group row required">
                <label class="col-sm-2 col-form-label" for="input-api-password">{{ entry_api_password }}</label>
                <div class="col-sm-10">
                  <input type="text" name="payment_cardconnect_api_password" value="{{ payment_cardconnect_api_password }}" placeholder="{{ entry_api_password }}" id="input-api-password" class="form-control"/>
                  <small class="form-text text-muted">{{ help_api_password }}</small>
                  {% if error_cardconnect_api_password %}
                    <div class="invalid-tooltip">{{ error_api_password }}</div>
                  {% endif %}</div>
              </div>
              <div class="form-group row required">
                <label class="col-sm-2 col-form-label" for="input-token">{{ entry_token }}</label>
                <div class="col-sm-10">
                  <input type="text" name="payment_cardconnect_token" value="{{ payment_cardconnect_token }}" placeholder="{{ entry_token }}" id="input-token" class="form-control"/>
                  <small class="form-text text-muted">{{ help_token }}</small>
                  {% if error_cardconnect_token %}
                    <div class="invalid-tooltip">{{ error_token }}</div>
                  {% endif %}</div>
              </div>
              <div class="form-group row">
                <label class="col-sm-2 col-form-label" for="input-transaction">{{ entry_transaction }}</label>
                <div class="col-sm-10">
                  <select name="payment_cardconnect_transaction" id="input-transaction" class="form-control">
                    {% if payment_cardconnect_transaction == 'payment' %}
                      <option value="payment" selected="selected">{{ text_payment }}</option>
                    {% else %}
                      <option value="payment">{{ text_payment }}</option>
                    {% endif %}
                    {% if payment_cardconnect_transaction == 'authorize' %}
                      <option value="authorize" selected="selected">{{ text_authorize }}</option>
                    {% else %}
                      <option value="authorize">{{ text_authorize }}</option>
                    {% endif %}
                  </select>
                  <small class="form-text text-muted">{{ help_transaction }}</small>
                </div>
              </div>
              <div class="form-group row required">
                <label class="col-sm-2 col-form-label" for="input-site">{{ entry_site }}</label>
                <div class="col-sm-10">
                  <input type="text" name="payment_cardconnect_site" value="{{ payment_cardconnect_site }}" placeholder="{{ entry_site }}" id="input-site" class="form-control"/>
                  <small class="form-text text-muted">{{ help_site }}</small>
                  {% if error_site %}
                    <div class="invalid-tooltip">{{ error_site }}</div>
                  {% endif %}</div>
              </div>
              <div class="form-group row">
                <label class="col-sm-2 col-form-label" for="input-environment">{{ entry_environment }}</label>
                <div class="col-sm-10">
                  <select name="payment_cardconnect_environment" id="input-environment" class="form-control">
                    {% if payment_cardconnect_environment == 'live' %}
                      <option value="live" selected="selected">{{ text_live }}</option>
                    {% else %}
                      <option value="live">{{ text_live }}</option>
                    {% endif %}
                    {% if payment_cardconnect_environment == 'test' %}
                      <option value="test" selected="selected">{{ text_test }}</option>
                    {% else %}
                      <option value="test">{{ text_test }}</option>
                    {% endif %}
                  </select>
                </div>
              </div>
              <div class="form-group row">
                <label class="col-sm-2 col-form-label" for="input-store-cards">{{ entry_store_cards }}</label>
                <div class="col-sm-10">
                  <select name="payment_cardconnect_store_cards" id="input-store-cards" class="form-control">
                    {% if payment_cardconnect_store_cards %}
                      <option value="1" selected="selected">{{ text_enabled }}</option>
                      <option value="0">{{ text_disabled }}</option>
                    {% else %}
                      <option value="1">{{ text_enabled }}</option>
                      <option value="0" selected="selected">{{ text_disabled }}</option>
                    {% endif %}
                  </select>
                  <small class="form-text text-muted">{{ help_store_cards }}</small>
                </div>
              </div>
              <div class="form-group row">
                <label class="col-sm-2 col-form-label" for="input-echeck">{{ entry_echeck }}</label>
                <div class="col-sm-10">
                  <select name="payment_cardconnect_echeck" id="input-echeck" class="form-control">
                    {% if payment_cardconnect_echeck %}
                      <option value="1" selected="selected">{{ text_enabled }}</option>
                      <option value="0">{{ text_disabled }}</option>
                    {% else %}
                      <option value="1">{{ text_enabled }}</option>
                      <option value="0" selected="selected">{{ text_disabled }}</option>
                    {% endif %}
                  </select>
                  <small class="form-text text-muted">{{ help_echeck }}</small>
                </div>
              </div>
              <div class="form-group row">
                <label class="col-sm-2 col-form-label" for="input-total">{{ entry_total }}</label>
                <div class="col-sm-10">
                  <input type="text" name="payment_cardconnect_total" value="{{ cardconnect_total }}" placeholder="{{ entry_total }}" id="input-total" class="form-control"/>
                  <small class="form-text text-muted">{{ help_total }}</small>
                </div>
              </div>
              <div class="form-group row">
                <label class="col-sm-2 col-form-label" for="input-geo-zone">{{ entry_geo_zone }}</label>
                <div class="col-sm-10">
                  <select name="payment_cardconnect_geo_zone" id="input-geo-zone" class="form-control">
                    <option value="0">{{ text_all_zones }}</option>
                    {% for geo_zone in geo_zones %}
                      {% if geo_zone.geo_zone_id == payment_cardconnect_geo_zone %}
                        <option value="{{ geo_zone.geo_zone_id }}" selected="selected">{{ geo_zone.name }}</option>
                      {% else %}
                        <option value="{{ geo_zone.geo_zone_id }}">{{ geo_zone.name }}</option>
                      {% endif %}
                    {% endfor %}
                  </select>
                </div>
              </div>
              <div class="form-group row">
                <label class="col-sm-2 col-form-label" for="input-status">{{ entry_status }}</label>
                <div class="col-sm-10">
                  <select name="payment_cardconnect_status" id="input-status" class="form-control">
                    {% if payment_cardconnect_status %}
                      <option value="1" selected="selected">{{ text_enabled }}</option>
                      <option value="0">{{ text_disabled }}</option>
                    {% else %}
                      <option value="1">{{ text_enabled }}</option>
                      <option value="0" selected="selected">{{ text_disabled }}</option>
                    {% endif %}
                  </select>
                </div>
              </div>
              <div class="form-group row">
                <label class="col-sm-2 col-form-label" for="input-logging">{{ entry_logging }}</label>
                <div class="col-sm-10">
                  <select name="payment_cardconnect_logging" id="input-logging" class="form-control">
                    {% if payment_cardconnect_logging %}
                      <option value="1" selected="selected">{{ text_enabled }}</option>
                      <option value="0">{{ text_disabled }}</option>
                    {% else %}
                      <option value="1">{{ text_enabled }}</option>
                      <option value="0" selected="selected">{{ text_disabled }}</option>
                    {% endif %}
                  </select>
                  <small class="form-text text-muted">{{ help_logging }}</small>
                </div>
              </div>
              <div class="form-group row">
                <label class="col-sm-2 col-form-label" for="input-sort-order">{{ entry_sort_order }}</label>
                <div class="col-sm-10">
                  <input type="text" name="payment_cardconnect_sort_order" value="{{ payment_cardconnect_sort_order }}" placeholder="{{ entry_sort_order }}" id="input-sort-order" class="form-control"/>
                </div>
              </div>
              <div class="form-group row">
                <label class="col-sm-2 col-form-label" for="input-cron-url">{{ entry_cron_url }}</label>
                <div class="col-sm-10">
                  <input type="text" name="cron_url" value="{{ cron_url }}" readonly placeholder="{{ entry_cron_url }}" id="input-cron-url" class="form-control"/>
                  <small class="form-text text-muted">{{ help_cron_url }}</small>
                </div>
              </div>
              <div class="form-group row">
                <label class="col-sm-2 col-form-label" for="input-cron-time">{{ entry_cron_time }}</label>
                <div class="col-sm-10">
                  <input type="text" name="payment_cardconnect_cron_time" value="{{ payment_cardconnect_cron_time }}" readonly disabled placeholder="{{ entry_cron_time }}" id="input-cron-time" class="form-control"/>
                  <small class="form-text text-muted">{{ help_cron_time }}</small>
                </div>
              </div>
            </div>
            <div class="tab-pane" id="tab-order-status">
              <div class="form-group row">
                <label class="col-sm-2 col-form-label" for="input-order-status-pending">{{ entry_order_status_pending }}</label>
                <div class="col-sm-10">
                  <select name="payment_cardconnect_order_status_id_pending" id="input-order-status-pending" class="form-control">
                    {% for order_status in order_statuses %}
                      {% if order_status.order_status_id == payment_cardconnect_order_status_id_pending %}
                        <option value="{{ order_status.order_status_id }}" selected="selected">{{ order_status.name }}</option>
                      {% else %}
                        <option value="{{ order_status.order_status_id }}">{{ order_status.name }}</option>
                      {% endif %}
                    {% endfor %}
                  </select>
                  <small class="form-text text-muted">{{ help_order_status_pending }}</small>
                </div>
              </div>
              <div class="form-group row">
                <label class="col-sm-2 col-form-label" for="input-order-status-processing">{{ entry_order_status_processing }}</label>
                <div class="col-sm-10">
                  <select name="payment_cardconnect_order_status_id_processing" id="input-order-status-processing" class="form-control">
                    {% for order_status in order_statuses %}
                      {% if order_status.order_status_id == payment_cardconnect_order_status_id_processing %}
                        <option value="{{ order_status.order_status_id }}" selected="selected">{{ order_status.name }}</option>
                      {% else %}
                        <option value="{{ order_status.order_status_id }}">{{ order_status.name }}</option>
                      {% endif %}
                    {% endfor %}
                  </select>
                  <small class="form-text text-muted">{{ help_order_status_processing }}</small>
                </div>
              </div>
            </div>
          </div>
        </form>
      </div>
    </div>
  </div>
</div>
{{ footer }}